//
//  DXVisitorTableViewController.swift
//  DXWeibo00
//
//  Created by xiongdexi on 16/4/7.
//  Copyright © 2016年 DXSmile. All rights reserved.
//  访客视图基类控制器

import UIKit

class DXVisitorTableViewController: UITableViewController {
    
    /// 用户是否登录的标记
    private var userLogin = false
    
    /// 访客视图属性
    var visitorView: DXVisitorView?
    
    override func loadView() {
        // 根据用户登录情况，决定显示的根视图
        userLogin ? super.loadView() : setupVisitorView()
    }
    
    override func viewDidAppear(animated: Bool) {
        super.viewDidAppear(animated)
        
    }
   
    /// 设置访客视图
    private func setupVisitorView() {

        visitorView = DXVisitorView()
        
//        view = UIView()
        view = visitorView
//        view.backgroundColor = UIColor.orangeColor()
        
        // 设置导航栏按钮
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: .Plain, target: nil, action: nil)
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", style: .Plain, target: nil, action: nil)
    }
}
